﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 类与对象
{
    //定义Monster类
    class Monster
    {
        //1 定义类的属性
        public int Hp = 100;
        public string Name = "警方探员";

        //2 定义类的行为（方法）
        public void shout()
        {
            Console.WriteLine("A1高闪");
        }
        public void run()
        {
            Console.WriteLine("撤退");
        }

    }
    internal class Program //主类
    {
        static void Main(string[] args)
        {
            Monster CT = new Monster();
            CT.Name = "苍蝇头";
            CT.Hp = 50;

            Console.WriteLine(CT.Hp);
            Console.WriteLine(CT.Name);

            CT.shout();
            CT.run();

            Monster T = new Monster();
            T.Name = "匪徒";

            Console.WriteLine(T.Hp);
            Console.WriteLine(T.Name);

            T.shout();
            T.run();

            Console.Read();
        }
    }
}
